#include <stdio.h>

#define MAX_SIZE 100

int main(int argc, char *argv[])
{
	int a[MAX_SIZE], i, j, n;
	scanf("%d", &n);
	for (i=0; i<n; i++) {
		scanf("%d", &a[i]);
	}

	for (i=0; i<n-1; i++) {
		for (j=i+1; j<n; j++) {
			if (a[i] > a[j]) {
				int t = a[i];
				a[i] = a[j];
				a[j] = t;
			}
		}
	}

	int cnt = 1;
	for (i=1; i<n; i++) {
		if (a[i] != a[i-1]) cnt++; 	
	}
	printf("%d\n", cnt);

	printf("%d ", a[0]);
	for (i=1; i<n; i++) {
		if (a[i] != a[i-1]) printf("%d ", a[i]);
	}
	printf("\n");

	return 0;
}
